4 Data Vis

Author

Matt Crump

Published

January 23, 2023

Read

Read the data-visualization chapter

https://psyteachr.github.io/ads-v2/03-viz.html

Big themes

This week we get our first start with actual data-visualization. Everything we do this week will be rehearsed and expanded upon for the rest of the semester.

There are three big topics this week:

  1. Data Types
  2. Tidy Data
  3. ggplot2

Data types refer to different kinds of data like numbers versus character strings, and different object types in R used to represent data.

Tidy data refers to a data organized in a table. It is also called “long-data”. Each row is an observation, and each column is a dependent or independent variable. The magic of tidy data is that once you get your data into this format you can apply many libraries from the tidyverse to your data-analysis.

Ggplot 2 is a library for making graphs. We will use it throughout the semester, and begin learning how it works this week.

Additional resources

Adding figures to quarto documents

https://quarto.org/docs/authoring/figures.html

ggplot 2

Package website:

https://ggplot2.tidyverse.org

Books:

https://ggplot2-book.org

https://r4ds.had.co.nz/data-visualisation.html

Week 4 assignment

Write a new blog post and submit the link to this assignment on blackboard. Write your blog around the three big themes:

  1. Data types: Show that you understand what is available to you in R. Note also, this goal overlaps with part of the midterm project. See the appendix on Data Types in the textbook for help. Write notes and R code chunks to demonstrate your knowledge

  2. Tidy Data: Show that you understand what this means. Give an example of data this is in tidy format, and data that is not.

  3. ggplot2: We will continue learning about this across the semester. Show at a minimum that you can make a graph and add it to your blog. Try examples from the textbook. Show that you understand the layer concept. Identify aspects that are confusing to you so we can discuss them in class.